#include <bits/stdc++.h>
using namespace std;
int main()
{
	int pa, pb, n = 3;
	int ppa = 0, ppb = 0, temp;
	cin >> pa >> pb;
	while(n--)
	{
		cin >> temp;
		temp == 0? ppa++:ppb++;
	} 
	if((pa > pb && ppa > 0) || (pa < pb && ppa == 3))
		cout << "The winner is a: " << pa << " + " << ppa;
	else
		cout << "The winner is b: " << pb << " + " << ppb;
	return 0;
} 
